package com.itheima.health.service.impl;

import com.itheima.health.dao.*;
import com.itheima.health.pojo.Order;
import com.itheima.health.service.ReService;
import com.itheima.health.service.ReportService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.*;

@DubboService
public class ReServiceImpl implements ReService {
    @Autowired
    private ReMapper reMapper;


    @Override
    public List<Integer> findMemberCountByMonths(List<String> months) {
        List<Integer> resultLIst = new ArrayList<>();
        for (String month : months) {
            String endDate = month+".31";
            Long count = reMapper.countByMonth(endDate);
            resultLIst.add(count.intValue());
        }
        return resultLIst;

    }
}
